package thread;

/****
 * 使用thread的sleep来实现多线程
 *
 */
public class ThreadTimer {
	static long count = 0;
	
	public static void main(String[] args) {
		Runnable runnable =new Runnable() {
			
			@Override
			public void run() {
				
				 while(true){
					 try {
							Thread.sleep(1000);
							count++;
							System.out.println(count);
						} catch (Exception e) {
						}
				 }
				
			}
		};
		
		Thread thread =new Thread(runnable);
		thread.start();
	}
}
